package com.gitee.cirnochat.chat.filter;

import java.security.Principal;

/**
 * 抽象消息过滤器
 * 提供了设置下一个过滤器和执行过滤的基本实现
 * @author FlanChan
 * @since 2025/6/28 14:22
 */
public abstract class AbstractMessageFilter implements MessageFilter {
    protected MessageFilter next;

    @Override
    public void setNext(MessageFilter next) {
        this.next = next;
    }

    @Override
    public void doFilter(Object message , Principal principal) {
        if (next != null) {
            next.doFilter(message,principal);
        }
    }
}